"""#演示while的基础应用
i=0
while i<10:
    print("123123")
    i+=1
#求1加到100的和
i=1
sum=1
while i<=100:
    sum+=i
    i+=1
    print(f"{sum}")
#猜数字的小游戏
import random
num=random.randint(1,100)
count=0
flag=True
while flag:
    num_1=int(input("才一个数字"))
    count+=1
    if num_1==num:
        print("caizhongle")
        flag=False
    else:
        if num_1>num:
            print("dale")
        else :

            print("xiao了")
print(f"一共才了{count}")
#while嵌套循环
print("hello",end="")
print("world")
print("hello\tWorld")
print("helloggaaworld")
#打印乘法小九九
#定义外层循环控制变量
i=1
while i<=9:


    #定义内层循环控制变量
    j=1
    while j<=(i-1):
        print(f"{j}*{i-1}={j*(i-1)}\t",end="")
        j+=1
    i+=1
    print()#输出空字符为了换行
i=1
while i<=9:
    j=1
    while j<=i:
        print(f"{j}*{i}={j*i}\t",end="")
        j+=1
    i+=1
    print()
#for循环的基础语法
name="wangkanglong"
for x in name:#将变量name内的字符挨个取出来赋值给X变量
    print(x)
#数一数有几个a
name="ittheheima is a branf of itcast"
count=0#定义一个变量有多少个a
for x in name:
    if x=="a":
        count+=1

print(f"{name}中共含有：{count}个字母a")
#range学习，语法一 range(num)
for x in range(5):
    print(x)
for z in range(5,9):r#range语法二range(num1,num2)
    print(z)
for u in range(3,9,2):#语法三range(num1,num2,step)
    print(u)
#练习 有几个偶数
num=100
i=0
for x in range(1,num):
    if x%2==0:
        i+=1
print(f"1到100(不含100本身)范围内,有{i}个偶数")
#演示for循环临时变量的作用域
for i in range(5):
    print(i)

print(i)
#演示嵌套应用for循环
#坚持表白一百天，每天都送十朵花
i=0
for i in range(1,101):
    print(f"今天是想小妹表白的{i}天")
    for j in range(1,11):
        print(f"每天向小美送{j}朵玫瑰")
    print("xiamei")
print(f"第{i}天表白成功")
#通过for循环来打印小九九
for i in range(1,10):
    for j in range(1,i+1):
        print(f"{j}*{i}={j*i}\t",end="")
    print()
for x in range(1,5):
    print("111")
    continue
    print("2222")
print("333")
for c in range(1,5):
    print("4444")
    break
    print("5555")
print("6666")"""
#发工资小案例
import random

m=10000
for x in range(1,21):
    num = random.randint(1, 10)
    if num<5:
        print(f"员工{x}，绩效分{num},低于5，不发工资，下一位")
        continue
    if m>=1000:
        m-=1000
        print(f"向员工{x}发放工资1000元，账户余额{m}元")
    else:
        print("工资发完了，下月领取吧")
        break



